<#include "../style/ztreeStyle.html"> 
<nav>

	<SCRIPT type="text/javascript">
		var setting =
		{
			async :
			{
				enable : true,
				url : '${contextPath}/member/getMembersFolders',
				autoParam : [ "id=ids", "name=n", "level=lv" ],
				dataFilter : filter,
				type : "post"
			},
			view :
			{
				expandSpeed : "",

				selectedMulti : false
			},
			check: {
				enable: true,
				chkStyle: "radio",
				chkboxType: { "Y": "", "N": "" }
			},
			data :
			{
				simpleData :
				{
					enable : true
				}
			},
			callback :
			{
				beforeCheck: beforeCheck,
				onCheck: onCheck
			}
		};
		///////////////////////////最开始的节点数据数据//////////////////////////
		var zNodes = [
		{
			id : "1",
			name : "公司成员",
			isParent : true,
			open : true,
			drag : false
		} ];

		/////////////////////////数据过滤///////////////////////////////////
		function filter(treeId, parentNode, childNodes)
		{

			if (!childNodes)
				return null;
			for ( var i = 0, l = childNodes.length; i < l; i++)
			{
				childNodes[i].name = childNodes[i].name.replace(/\.n/g, '.');
			}
			return childNodes;
		}
		
		
		//////////////////选中事件处理////////////////////
		
		var className = "dark";
		
		function beforeCheck(treeId, treeNode) {
			className = (className === "dark" ? "":"dark");
			return (treeNode.doCheck !== false);
		}
			
		function onCheck(e, treeId, treeNode) {
			var id = treeNode.id;
			var name = treeNode.name;

	
		}
			/////////////////////初始化数据///////////////////////////////////////////
		$(document).ready(function()
		{
			$.fn.zTree.init($("#checkboxMem"), setting, zNodes);
		});
	</SCRIPT>
	<div>
		<ul id="checkboxMem" class="ztree"></ul>
	</div>

</nav>
